home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / src.zoo / src / sigdata.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-17  |  2.3 KB  |  65 lines

  1. /*                        Copyright (c) 1987 Bellcore
  2.  *                            All Rights Reserved
  3.  *       Permission is granted to copy or use this program, EXCEPT that it
  4.  *       may not be sold for profit, the copyright notice must be reproduced
  5.  *       on copies, and credit should be given to Bellcore where it is due.
  6.  *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  */
  8. /*    $Header: sigdata.c,v 1.1 89/03/17 08:21:21 sau Exp $
  9.     $Source: /m1/mgr.new/src/RCS/sigdata.c,v $
  10. */
  11. static char    RCSid_[] = "$Source: /m1/mgr.new/src/RCS/sigdata.c,v $$Revision: 1.1 $";
  12.  
  13. #include <stdio.h>
  14.  
  15. /* signal names, descriptions (for debugging) */
  16.  
  17. struct signame {
  18.    char *symbol;
  19.    int  number;
  20.    char *desc;
  21.    } signames[] = {
  22.    "SIGNONE",    0,    "Internal mgr error",
  23.    "SIGHUP",    1,    "hangup",
  24.    "SIGINT",    2,    "interrupt",
  25.    "SIGQUIT",    3,    "quit",
  26.    "SIGILL",    4,    "illegal instruction (not reset when caught)",
  27.    "SIGTRAP",    5,    "trace trap (not reset when caught)",
  28.    "SIGIOT",    6,    "IOT instruction",
  29.    "SIGEMT",    7,    "EMT instruction",
  30.    "SIGFPE",    8,    "floating point exception",
  31.    "SIGKILL",    9,    "kill (cannot be caught or ignored)",
  32.    "SIGBUS",    10,    "bus error",
  33.    "SIGSEGV",    11,    "segmentation violation",
  34.    "SIGSYS",    12,    "bad argument to system call",
  35.    "SIGPIPE",    13,    "write on a pipe with no one to read it",
  36.    "SIGALRM",    14,    "alarm clock",
  37.    "SIGTERM",    15,    "software termination signal from kill",
  38.    "SIGURG",    16,    "urgent condition on IO channel",
  39.    "SIGSTOP",    17,    "sendable stop signal not from tty",
  40.    "SIGTSTP",    18,    "stop signal from tty",
  41.    "SIGCONT",    19,    "continue a stopped process",
  42.    "SIGCHLD",    20,    "to parent on child stop or exit",
  43.    "SIGTTIN",    21,    "to readers pgrp upon background tty read",
  44.    "SIGTTOU",    22,    "like TTIN for output if (tp->t_local<OSTOP)",
  45.    "SIGIO",    23,    "input/output possible signal",
  46.    "SIGXCPU",    24,    "exceeded CPU time limit",
  47.    "SIGXFSZ",    25,    "exceeded file size limit",
  48.    "SIGVTALRM",    26,    "virtual time alarm",
  49.    "SIGPROF",    27,    "profiling time alarm",
  50.    "SIGWINCH",    28,    "window changed",
  51.    (char *) 0,    0,    (char *) 0
  52.    };
  53.  
  54. /* unexpected signals go here, print message, restore state, then die! */
  55.  
  56. int
  57. catch(sig)
  58. int sig;
  59.    {
  60.    _quit();
  61.    fprintf(stderr,"got a %s:\t%s\r\n",signames[sig].symbol, signames[sig].desc);
  62.    fflush(stderr);
  63.    abort();
  64.    }
  65.